package sol.leetcode;

/**
 * Excel Sheet Column Number
 * Created by lkk on 2016/8/28.
 */
public class Issue171 {
    public static int titleToNumber(String s) {
        int col = 0;//记录结果
        for (char c : s.toCharArray()) {
            int n = c - 'A' + 1;//
            col = 26 * col + n;
        }
        return col;
    }

    public static void main(String[] args) {
        System.out.println(titleToNumber("A"));
    }
}
